#ifndef SYNTAXTREEMODEL_H
#define SYNTAXTREEMODEL_H

#include <QAbstractItemModel>
#include <QIcon>

#include "syntaxanalyser.h"

class SyntaxTreeModel : public QAbstractItemModel
{
	Q_OBJECT

public:
	SyntaxTreeModel(QObject *parent);
	SyntaxTreeModel(SyntaxTreeNode* root, QObject *parent);
	~SyntaxTreeModel();

	QModelIndex parent ( const QModelIndex & index ) const;
	QModelIndex index( int row, int column, const QModelIndex & parent) const;
	Qt::ItemFlags flags ( const QModelIndex & index ) const;
	QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
	QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
	int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
	int columnCount ( const QModelIndex & parent = QModelIndex() ) const;

	void setRoot(SyntaxTreeNode* root);

private:
	SyntaxTreeNode* m_SyntaxTree;	
};

#endif // SYNTAXTREEMODEL_H
